package com.camelot.ccr.system.persistence;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * <pre>
 * 车手
 * </pre>
 * @author Niu Lina
 * @version V0.1, 2014-1-7 上午10:45:34
 */
@Entity
@Table(name = "t_driver")
public class Driver implements java.io.Serializable {

	private static final long serialVersionUID = -1506581774705067784L;
    /**
     * 主键id
     */
    @Id
    @Column(name = "id", unique = true, nullable = false)
    @GenericGenerator(name="idGenerator", strategy="uuid") //这个是hibernate的注解
    @GeneratedValue(generator="idGenerator") //使用uuid的生成策略
	private String id;
    /**
     * 车手姓名
     */
    @Column(name = "driverName", length = 120)
	private String driverName;
    /**
     * 生日
     */
    @Column(name = "birthday")
	private Date birthday;
    /**
     * 出生地
     */
    @Column(name = "birthplace", length = 200)
	private String birthplace;
    /**
     * 头像
     */
    @Column(name = "headPhoto", length = 500)
	private String headPhoto;
    /**
     * 国籍
     */
    @Column(name = "nationality", length = 200)
	private String nationality;
    /**
     * 身高
     */
    @Column(name = "height")
	private Float height;
    /**
     * 车号
     */
    @Column(name = "carNo", length = 100)
	private String carNo;
    /**
     * 车队
     */
    @OneToOne
    @JoinColumn(name = "team")
	private Team team;
    
    /**
     * 创建时间
     */
    @Column(name = "createTime")
	private Date createTime;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDriverName() {
		return driverName;
	}

	public void setDriverName(String driverName) {
		this.driverName = driverName;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getBirthplace() {
		return birthplace;
	}

	public void setBirthplace(String birthplace) {
		this.birthplace = birthplace;
	}

	public String getNationality() {
		return nationality;
	}

	public void setNationality(String nationality) {
		this.nationality = nationality;
	}

	public Float getHeight() {
		return height;
	}

	public void setHeight(Float height) {
		this.height = height;
	}

	public String getCarNo() {
		return carNo;
	}

	public void setCarNo(String carNo) {
		this.carNo = carNo;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public String getHeadPhoto() {
		return headPhoto;
	}

	public void setHeadPhoto(String headPhoto) {
		this.headPhoto = headPhoto;
	}
	
}